import packageJson from '../package.json';

const { name, version, config } = packageJson;
export default {
  code: name,
  version,
  width: config.width,
  height: config.height,
  coordinate: {
    x: 0,
    y: 0,
  },
  config: [
    {
      name: '主题样式',
      code: 'theme',
      value: 'square',
      type: 'Radio',
      enumValue: [
        {
          key: '矩形',
          value: 'square',
        },
        {
          key: '圆形',
          value: 'circle',
        },
        {
          key: '平行四边形',
          value: 'rect',
        },
      ],
    },
    {
      name: '倾斜角度(平行四边形可用)',
      code: 'rectAngle',
      value: 30,
      type: 'InputNumber',
      min: 0,
      max: 60,
    },
    {
      name: '背景投影角度',
      code: 'angle',
      value: 45,
      type: 'InputNumber',
      min: 0,
      max: 360,
    },
    {
      name: '主题颜色',
      code: 'backgroundColor',
      value: '#2949B1-rgba(36,215,189,0.25)',
      type: 'CustomColors',
    },
    {
      name: '自定义配置项',
      code: 'isProd',
      type: 'EnvSwitch',
      value: true,
    },
    {
      name: '基础样式设置',
      code: 'style1',
      children: [
        {
          name: '单选Radio',
          code: 'radioCode',
          value: 'a',
          type: 'Radio',
          enumValue: [
            { key: '选项A', value: 'a' },
            { key: '选项B', value: 'b' },
            { key: '选项C', value: 'c' },
          ],
        },
        {
          name: '下拉框Select',
          code: 'selectCode',
          value: 'a',
          type: 'Select',
          enumValue: [
            { key: '选项A', value: 'a' },
            { key: '选项B', value: 'b' },
            { key: '选项C', value: 'c' },
          ],
        },
        {
          name: '文本输入Input',
          code: 'inputCode',
          value: 'text',
          type: 'Input',
        },
        {
          name: '数字输入InputNumber',
          code: 'numberCode',
          value: '16',
          min: 0,
          max: 100,
          type: 'InputNumber',
          unit: '单位',
        },
        {
          name: '开关CheckBox',
          code: 'booleanCode',
          value: true,
          type: 'CheckBox',
        },
        {
          name: '颜色选择ColorSelector',
          code: 'colorCode',
          value: '#021625',
          type: 'ColorSelector',
        },
        {
          name: '文本设置FontGroup',
          code: 'fontCode',
          value: {
            fontSize: 18,
            fontFamily: 'Microsoft YaHei',
            color: '#177AE2',
            fontWeight: 'bold',
          },
          type: 'FontGroup',
        },
        {
          name: '图片设置ImgUpdate',
          code: 'imgUpdateCode',
          value: '',
          type: 'ImgUpdate',
        },
      ],
    },
    {
      name: '复杂样式设置',
      code: 'style2',
      children: [
        {
          name: '颜色数据组合RangeColors',
          code: 'rangeColorsCode',
          type: 'RangeColors',
          min: 1,
          value: [
            {
              id: 1000,
              start: 0,
              end: 20,
              color: '#0233CE',
            },
            {
              id: 999,
              start: 20,
              end: 40,
              color: '#0159FF',
            },
          ],
          template: {
            start: 0,
            end: 100,
            color: '#0233CE',
          },
        },
        {
          name: '选项切换ChangeConfig',
          code: 'changeConfigCode',
          type: 'ChangeConfig',
          value: {
            type: 'a',
            inputCode: 'text',
            numberCode: 88,
            booleanCode: false,
            colorCode: '#963',
          },
          enumValue: [
            {
              key: '卡片A',
              value: 'a',
              change: [
                {
                  name: '文本输入Input',
                  code: 'inputCode',
                  type: 'Input',
                },
                {
                  name: '数字输入InputNumber',
                  code: 'numberCode',
                  min: 0,
                  max: 100,
                  type: 'InputNumber',
                  unit: '单位',
                },
              ],
            },
            {
              key: '卡片B',
              value: 'b',
              change: [
                {
                  name: '开关CheckBox',
                  code: 'booleanCode',
                  type: 'CheckBox',
                },
                {
                  name: '颜色选择ColorSelector',
                  code: 'colorCode',
                  type: 'ColorSelector',
                },
              ],
            },
          ],
        },
        {
          name: '特殊配置AddConfig',
          type: 'AddConfig',
          code: 'special',
          value: [
            {
              numberCode: 1,
              fontCode: {
                fontSize: 18,
                fontFamily: 'Microsoft YaHei',
                color: '#963',
                fontWeight: 'bold',
              },
            },
          ],
          min: 1,
          max: 10,
          template: {
            numberCode: 0,
            fontCode: {
              fontSize: 18,
              fontFamily: 'Microsoft YaHei',
              color: '#177AE2',
              fontWeight: 'bold',
            },
          },
          series: [
            {
              name: '数字输入InputNumber',
              code: 'numberCode',
              min: 0,
              max: 100,
              type: 'InputNumber',
              unit: '单位',
            },
            {
              name: '文本设置',
              code: 'fontCode',
              type: 'FontGroup',
            },
          ],
        },
      ],
    },
  ],
  data: {
    interval: 5,
    polling: 0,
    field: [
      { name: 'name', mapper: 'city' },
      { name: 'value', mapper: 'value' },
    ],
    type: 1,
    value: JSON.stringify([
      { city: '上海', value: 40 },
      { city: '深圳', value: 35 },
    ]),
  },
  events: {},
};
